<?php
class ViewHelperFactory implements Factory{
	/**
	 * (non-PHPdoc)
	 * @see library/Factory/Factory::getInstance()
	 * @param ControllerRoute $route
	 * @return Controller
	 */
	public function getInstance($route){
		return null;
	}
	public static function instance($context){
		
	}
	/**
	 * Get ViewHelper by Class ...
	 * @param string $viewName
	 * @return ViewHelper
	 */
	public static function vinstance($module,$viewName){
		$viewPath = Configuration::APPLICATION_FOLDER
		. SLASH
		. $module
		. SLASH
		. Configuration::VIEW_HEPLER_FOLDER
		. SLASH
		. $viewName .'.php';
		if(file_exists($viewPath)){
			include_once $viewPath;
			$class = $context.Configuration::VIEW_HEPLER_FOLDER;
			if(!class_exists($context)){
				Log::error("ViewHelperFactory", "Class " . $class . " Not found");
				if(Configuration::DEBUG_MOD)
				throw new ViewHelperException("Class " . $class . " Not found");
			}
			return new $context;
		}
		return new ViewHelper();
	}
}